package com.shrct.businessprocess.purchase.impl;

import com.shrct.businessprocess.budget.RCBudget;
import com.shrct.businessprocess.budget.RCCostBreakDown;
import com.shrct.businessprocess.purchase.RCProductPurchaseBudget;
import com.shrct.businessprocess.purchase.RCProductPurchaseBudgetDAO;
import com.shrct.businessprocess.purchase.impl.RCProductPurchaseBudgetImpl;
import edu.fudan.mylang.pf.BaseService;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.purchase.RCProductPurchaseBudgetDAO")
public class RCProductPurchaseBudgetDAOImpl extends BaseService implements RCProductPurchaseBudgetDAO {
  public RCProductPurchaseBudget create(final RCCostBreakDown owner, final Procedure1<? super RCProductPurchaseBudget> preInit) {RCProductPurchaseBudget rCProductPurchaseBudget=RCProductPurchaseBudgetImpl.create(owner,getObjectFactory());
    final Procedure1<RCProductPurchaseBudget> _function = new Procedure1<RCProductPurchaseBudget>() {
        public void apply(final RCProductPurchaseBudget it) {
          preInit.apply(it);
          Collection<RCBudget> _budgets = owner.getBudgets();
          _budgets.add(it);
        }
      };
    RCProductPurchaseBudget _doubleArrow = ObjectExtensions.<RCProductPurchaseBudget>operator_doubleArrow(rCProductPurchaseBudget, _function);
    return _doubleArrow;
  }
}
